#include <bits/stdc++.h>

using namespace std;

#define int long long

void solve()
{
    string s;
    cin >> s;
    int n = s.size();
    int bal = 0;
    for(int i = 1;i + 1 < n;i ++)
    {
        if(s[i] == '(') bal++;
        else bal --;
        if(bal < 0)
        {
            cout << "YES" << endl;
            return;
        }
    }
    if(bal == 0)
    {
        cout << "NO" << endl;
    }
    else cout << "YES" << endl;
}
signed main()
{
    int t; cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}